package com.menggudf.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.menggudf.model.ResultModel;
import com.menggudf.service.MedicineService;

@Controller
@RequestMapping("/medicine")
public class MedicineController {
    
    @Autowired
    private MedicineService medicineService;
    
    @RequestMapping("/getDetail")
    @ResponseBody
    public ResultModel getDetail(
            @RequestParam(value="name") String name ){
                return medicineService.getDetailInDB(name);
        
    }
    
    @RequestMapping("/getMedicineDetail")
    @ResponseBody
    public ResultModel getMedicineDetail(
            @RequestParam(value="names") List<String> names ){
                return medicineService.getDetailInDB(names);
        
    }
    
}
